package cn.jark.example.web.controller;

import cn.jark.example.web.entity.AdContract;
import cn.jark.example.web.entity.User;
import cn.jark.example.web.service.IAdContractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 雨一直夏灬(须知少年凌云志, 曾许人间第一流)
 * @since 2020-10-28
 */
@RestController
public class DemoController {

    @Autowired
    IAdContractService adContractService;

    @GetMapping("/test")
    public String test() {
        return "ok";
    }

    @GetMapping("/test2")
    public User test2() {
        return new User("jack", 12);
    }


    @GetMapping("/ad-contracts")
    public List<AdContract> listAll() {
        adContractService.save(null);
        return null;
    }

}
